<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>管理员个人信息 - 在线考试系统</title>
    <link href="/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="/css/all.min.css">
    <style>
        body { background-color: #f5f7fb; }
        .profile-card {
            background: #fff;
            border-radius: 16px;
            box-shadow: 0 4px 20px rgba(67,97,238,0.10);
            padding: 0;
            max-width: 540px;
            margin: 3rem auto 2rem auto;
            overflow: hidden;
        }
        .profile-avatar {
            width: 90px;
            height: 90px;
            border-radius: 50%;
            background: linear-gradient(135deg, #7209b7, #4361ee);
            color: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 2.8rem;
            margin: 0 auto 1.2rem auto;
            box-shadow: 0 2px 10px rgba(67,97,238,0.10);
        }
        .profile-title {
            font-weight: 700;
            font-size: 1.5rem;
        }
        .profile-role {
            color: #4361ee;
            font-weight: 500;
        }
        .profile-info label {
            color: #888;
            min-width: 90px;
            display: inline-block;
        }
        .profile-actions {
            text-align: center;
            margin-top: 2rem;
        }
        .btn-back {
            background: linear-gradient(135deg, #4361ee, #3f37c9);
            color: #fff;
            border: none;
            border-radius: 8px;
            padding: 0.5rem 2rem;
            font-weight: 600;
        }
        .btn-back:hover {
            background: #3f37c9;
        }
        .btn-primary {
            background: linear-gradient(135deg, #4361ee, #3f37c9);
            border: none;
            border-radius: 8px;
            font-weight: 600;
        }
        .btn-primary:hover {
            background: #3f37c9;
        }
        .form-control, .form-select {
            border-radius: 8px;
            box-shadow: none;
            border: 1px solid #e0e7ff;
        }
        .form-control:focus, .form-select:focus {
            border-color: #4361ee;
            box-shadow: 0 0 0 2px #e0e7ff;
        }
        .footer {
            background: linear-gradient(135deg, #4361ee, #3f37c9);
            color: white;
            padding: 2rem 0 1rem 0;
            margin-top: 3rem;
        }
        .footer .copyright {
            text-align: center;
            color: rgba(255,255,255,0.8);
            font-size: 0.95rem;
            margin-top: 0.5rem;
        }
        .footer a {
            color: #fff;
            font-size: 1.7rem;
            margin: 0 8px;
            transition: color 0.2s;
        }
        .footer a:hover {
            color: #ffd700;
        }
    </style>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark" style="background: linear-gradient(135deg, #4361ee, #3f37c9);">
    <div class="container">
        <a class="navbar-brand" href="/admin/users"><i class="fas fa-graduation-cap"></i> 在线考试系统</a>
        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarNav">
            <ul class="navbar-nav me-auto">
                <li class="nav-item">
                    <a class="nav-link" href="/admin/users"><i class="fas fa-home"></i> 主页</a>
                </li>
            </ul>
            <ul class="navbar-nav ms-auto">
                <li class="nav-item">
                    <a class="nav-link active" href="/admin/profile"><i class="fas fa-user-circle"></i> 个人信息</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="/logout"><i class="fas fa-sign-out-alt"></i> 退出登录</a>
                </li>
            </ul>
        </div>
    </div>
</nav>
<div class="container" style="max-width:540px;margin:3rem auto 2rem auto;">
    <div class="profile-card p-0">
        <div style="background:linear-gradient(90deg,#4361ee 60%,#fff 100%);padding:2rem 2rem 1.2rem 2rem;display:flex;align-items:center;gap:1.5rem;">
            <div style="width:90px;height:90px;border-radius:50%;background:linear-gradient(135deg,#fff,#4361ee 80%);color:#4361ee;display:flex;align-items:center;justify-content:center;font-size:2.8rem;box-shadow:0 2px 10px rgba(67,97,238,0.10);border:4px solid #fff;">
                <i class="fas fa-user-shield"></i>
            </div>
            <div style="flex:1;">
                <div class="profile-title mb-1" th:text="${admin.realName != null && admin.realName != '' ? admin.realName : admin.userName}" style="color:#fff;text-shadow:0 2px 8px rgba(67,97,238,0.18);">管理员</div>
                <div class="profile-role mb-2" style="color:#e0e7ff;">系统管理员</div>
            </div>
        </div>
        <div class="p-4 pt-3">
            <form th:action="@{/admin/profile/update}" method="post">
                <div class="mb-3">
                    <label>用户ID：</label>
                    <input type="text" class="form-control" name="userId" th:value="${admin.userId}" readonly>
                </div>
                <div class="mb-3">
                    <label>用户名：</label>
                    <input type="text" class="form-control" name="userName" th:value="${admin.userName}" required>
                </div>
                <div class="mb-3">
                    <label>密码：</label>
                    <input type="password" class="form-control" name="password" th:value="${admin.password}" required autocomplete="new-password">
                </div>
                <div class="mb-3">
                    <label>角色：</label>
                    <input type="text" class="form-control" name="role" th:value="${admin.role}" readonly>
                </div>
                <div class="mb-3">
                    <label>邮箱：</label>
                    <input type="email" class="form-control" name="email" th:value="${admin.email}" required>
                </div>
                <div class="mb-3">
                    <label>手机号：</label>
                    <input type="text" class="form-control" name="phone" th:value="${admin.phone}">
                </div>
                <div class="mb-3">
                    <label>真实姓名：</label>
                    <input type="text" class="form-control" name="realName" th:value="${admin.realName}">
                </div>
                <div class="profile-actions text-center mt-4">
                    <button type="submit" class="btn btn-primary">保存修改</button>
                    <a href="/admin/users" class="btn btn-back ms-2"><i class="fas fa-arrow-left me-2"></i>返回主页</a>
                </div>
            </form>
        </div>
    </div>
</div>
<footer class="footer">
    <div class="container text-center">
        <a href="https://gitee.com/sorrymaker04/onlineexam-workload" target="_blank"><i class="fab fa-github"></i></a>
        <div class="copyright mt-2">
            &copy; 2023 在线考试系统 版权所有
        </div>
    </div>
</footer>
<script src="/js/bootstrap.bundle.min.js"></script>
<!-- 引入ECharts -->
<script src="/js/echarts.min.js"></script>
<script th:inline="none">
document.addEventListener('DOMContentLoaded', function() {
    var chart = echarts.init(document.getElementById('profileProgress'));
    var colorArr = [
        [0.8, '#4361ee'],
        [1, '#e0e7ff']
    ];
    chart.setOption({
        series: [{
            type: 'gauge',
            startAngle: 90,
            endAngle: -270,
            progress: { show: true, width: 10 },
            axisLine: { lineStyle: { width: 10, color: colorArr } },
            pointer: { show: false },
            axisTick: { show: false },
            splitLine: { show: false },
            axisLabel: { show: false },
            detail: {
                valueAnimation: true,
                fontSize: 18,
                color: '#4361ee',
                offsetCenter: [0, '60%'],
                formatter: '{value}%'
            },
            data: [{ value: 80 }]
        }]
    });
});
</script>
</body>
</html> 